From: Florian Müllner Date: Thu, 19 Sep 2024 22:33:29 +0000 (+0200) Subject: status/keyboard: Fix execution order when activating source X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~173^2^2~222 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0a3c12f8d6c21906ae5c2b0677501a2897abdd83;p=gnome-shell.git status/keyboard: Fix execution order when activating source When commit ce89b15bb123d made the code async, it did not only delay releasing the keyboard until after the engine has been updated, but also the following code that updates the current input source. One result is that the current source is now initialized later, which breaks any code that relies on the source being set. This affects the login screen in particular (which uses different `InputSourceSettings` than the regular session): It fails to come up entirely if the OSK is enabled. To fix the issue, use a .then() callback to release the keyboard, instead of blocking all following code with await. Fixes: ce89b15bb1 ("ibusManager: Use async await instead of callbacks") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7912 Part-of: --- diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index d900d3ed7..3be8f2cba 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -495,7 +495,7 @@ export class InputSourceManager extends Signals.EventEmitter { this._changePerWindowSource(); } - async activateInputSource(is, interactive) { + activateInputSource(is, interactive) { // The focus changes during holdKeyboard/releaseKeyboard may trick // the client into hiding UI containing the currently focused entry. // So holdKeyboard/releaseKeyboard are not called when @@ -519,9 +519,10 @@ export class InputSourceManager extends Signals.EventEmitter { else engine = 'xkb:us::eng'; - await this._ibusManager.setEngine(engine); - if (!this._reloading) - KeyboardManager.releaseKeyboard(); + this._ibusManager.setEngine(engine).then(() => { + if (!this._reloading) + KeyboardManager.releaseKeyboard(); + }); this._currentInputSourceChanged(is);